import {eventBus} from "../../../../../../eventbus/eventbus";

/**
 * @type {LibraryItem|null}
 */
let curItem = null;

const renameElementLibraryItemPreview = {
  validate(_, item) {
    curItem = item;
    return !item?.system;
  },
  execute() {
    eventBus.emit("renameElementLibraryItemPreview", curItem.id);
  }
};

export default renameElementLibraryItemPreview;